package com.seeyon.apps.gkcwplugin.util;

import java.sql.Connection;
import java.sql.DriverManager;

import com.seeyon.ctp.common.AppContext;

public class BaseConnection {
	public static Connection getConnection(){//用这个方法获取mysql的连接
	   	 Connection conn=null;
	   	 try{
	   		 String driverClass=AppContext.getSystemProperty("gkcwplugin.DBDriverClass");
	   		 String url=AppContext.getSystemProperty("gkcwplugin.DBUrl");
	   		 String user=AppContext.getSystemProperty("gkcwplugin.DBUser");
	   		 String password=AppContext.getSystemProperty("gkcwplugin.DBPassword");
	   		 Class.forName(driverClass);//加载驱动类
	   		 conn=DriverManager.getConnection(url,user,password);
	   	 }catch(Exception e){
	   		 e.printStackTrace();
	   	 }
	   	 return conn;
	    }
}
